// Playground - noun: a place where people can play

import Cocoa


/*********************************************************************
 * The Swift Language Learning  Chapter 11: Subcripts
 *********************************************************************/


struct TimesTable {
	
	let multiplier: Int
	
	subscript(index:Int) -> Int {
		return multiplier * index
	}
	
	//overwrite to enabel more than one parameters
	subscript(indexa:Int, indexb:Int) -> Int{
		return indexa * indexb
	}
}

let t = TimesTable(multiplier: 5)
t[6]
t[6,5]
















